Skip to content

Review: AI/ML tutorials (batch 1)#31

Open
mwunderl wants to merge 4 commits intomainfrom
review/ai-ml-batch-1
Open

Review: AI/ML tutorials (batch 1)#31
mwunderl wants to merge 4 commits intomainfrom
review/ai-ml-batch-1

Conversation

@mwunderl
Copy link
Copy Markdown
Contributor

Tutorials in this batch

  • tuts/090-amazon-comprehend-gs — Detect sentiment, entities, and key phrases
  • tuts/091-amazon-translate-gs — Translate text between languages
  • tuts/103-amazon-textract-gs — Extract text from documents
  • tuts/104-amazon-polly-gs — Synthesize speech from text
  • tuts/105-amazon-rekognition-gs — Detect labels in images

All scripts tested end-to-end. Each tutorial includes a README with structured metadata and generation details appendix.

Test results

Tutorial Duration Steps Status
Comprehend 5s 5 PASS
Translate 5s 5 PASS
Textract 10s 5 PASS
Polly 5s 6 PASS
Rekognition 10s 6 PASS

- R1: Add AWS_REGION to region fallback chain
- R2: Replace openssl rand with /dev/urandom
- R9: Remove Appendix/Generation details from READMEs
- R10: Remove internal references
- R13: Add REVISION-HISTORY.md
## Step 1: Detect the dominant language

```bash
aws comprehend detect-dominant-language --text "Your text here" \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a more interesting example text


## Step 1: Create a sample document image

Generate a minimal PNG image to use as a test document. In practice, you would use a scanned document or photograph containing text.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's get sample images into the project so we don't need this step


## Step 5: Detect text from local file bytes

Send the document directly as base64-encoded bytes instead of referencing S3.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's lead with this method, and include the s3 option as a secondary example. don't include the command to create the S3 bucket in the tutorial, just note it as a prereq if you want to use that method.

echo "Region: $REGION"

RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
BUCKET_NAME="textract-tut-${RANDOM_ID}-${ACCOUNT_ID}"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if the bucket stack exists and use that bucket if it's available.


## Step 1: Create a sample image

Generate a 100×100 gradient PNG using Python. The gradient gives Rekognition color data to analyze.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a sample image in the repo and skip this step

090-comprehend: Replace placeholder 'Your text here' with interesting example text
103-textract: Lead with local file method, S3 as secondary option
103-textract: Script checks for prereq bucket stack before creating one
105-rekognition: Use repo sample image, remove Python image generation step
sample-images/: Add placeholder images (to be replaced with real samples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant